/******/ (() => { // webpackBootstrap var __webpack_exports__ = {}; /*!*******************************************************!*\ !*** ./resources/js/design_1/parts/content_delete.js ***! \*******************************************************/ (function ($) { "use strict"; $('body').on('click', '.js-content-delete-action', function (e) { e.preventDefault(); e.stopPropagation(); var $this = $(this); var href = $this.attr('href'); var itemId = $this.attr('data-item'); var itemType = $this.attr('data-item-type'); var bodyHtml = "\n
\n
\n
".concat(bulDangerIcon, "
\n
\n\n

").concat(deleteRequestTitleLang, "

\n
\n\n
").concat(deleteRequestDescriptionLang, "
\n\n
\n \n \n\n
\n \n \n
\n
\n
"); var $footerHtml = "
\n \n \n
"); var html = makeModalHtml(deleteRequestLang, closeIcon, bodyHtml, $footerHtml); Swal.fire({ html: html, showCancelButton: false, showConfirmButton: false, customClass: { content: 'p-0 text-left' }, width: '37rem' }); }); $('body').on('click', '.js-send-delete-request', function (e) { e.preventDefault(); var $this = $(this); var form = $this.closest('.js-custom-modal').find('.js-delete-content-form'); var data = serializeObjectByTag(form); var action = form.attr('data-action'); $this.addClass('loadingbar primary').prop('disabled', true); form.find('textarea').removeClass('is-invalid'); $.post(action, data, function (result) { if (result && result.code === 200) { //window.location.reload(); Swal.fire({ icon: 'success', title: result.title, html: '

' + result.msg + '

', showConfirmButton: false, width: '25rem' }); setTimeout(function () { window.location.reload(); }, 1500); } }).fail(function (err) { $this.removeClass('loadingbar primary').prop('disabled', false); var errors = err.responseJSON; if (errors && errors.errors) { Object.keys(errors.errors).forEach(function (key) { var error = errors.errors[key]; var element = form.find('.js-ajax-' + key); element.addClass('is-invalid'); element.parent().find('.invalid-feedback').text(error[0]); }); } }); }); })(jQuery); /******/ })() ;